package org.yxj.lib_downfile.i;

import org.yxj.lib_downfile.bean.DownFileBean;
import org.yxj.lib_downfile.down.DownFileTask;
import java.io.File;


/**
 * @author on 2022/8/26
 */
public abstract class DownFileProgressListener {


    /**
     * 文件已下载
     *
     */
    public void onHaveDownloaded(File file){}

    /**
     * 下载准备
     */
    public void onPending(DownFileTask task,long progress, long total){}

    /**
     * 当前下载进度
     * @param progress
     * @param total
     */
    public abstract void onProgress(DownFileBean downFileBean, long progress, long total);

    /**
     *
     * 下载完成
     */
    public void onComplete(DownFileTask task,DownFileBean downFileBean){}

    /**
     * 下载失败
     *
     * @param task
     */
    public void onFail(DownFileTask task,String error){}

    /**
     * 取消
     *
     * @param call
     */
    public void cancel(DownFileTask task){}
}
